from xkw_UI_auto.BasePages.basePage import BasePage
from xkw_UI_auto.LocatorEelements.bk_locator.edit_locator import EditLocator as loc


class EditPage(BasePage):

    def get_center_msg(self):
        doc = '备课功能_编辑页面_获取提示信息'
        return self.get_element_text(loc.edit_center_Msg, doc)

    def save_file(self):
        doc = '备课功能_编辑页面_保存'
        self.click_element(loc.edit_save_file, doc)

    def get_file_name(self):
        doc = '备课功能_编辑页面_获取文件名'
        return self.get_element_text(loc.edit_page_file_name, doc)

    def reName_file(self, fileName):
        doc = '备课功能_编辑页面_文件重命名'
        self.click_element(loc.edit_file_edit, doc)
        self.input_text(loc.edit_page_input, fileName, doc)
        self.click_element(loc.edit_page_file_name_submit, doc)

    def client_download(self):
        doc = '备课功能_编辑页面_点击客户端下载'
        self.click_element(loc.edit_page_download, doc)

    def close_edit_page(self):
        doc = '备课功能_编辑页面_点击logo关键编辑页面'
        self.click_element(loc.edit_page_logo, doc)


